Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Device Communications Messages


GXOpenConnectionRetry

QuickDraw GX sends the GXOpenConnectionRetry message if opening the connection fails. You can override the GXOpenConnectionRetry message to try again to open the connection for a device. Your override of the GXOpenConnectionRetry message must match the following formal declaration:

OSErr MyOpenConnectionRetry (ResType commType, void *commData, 
                           Boolean *pRetry, OSErr saveErr);
commType
The resource type of the communications ('comm') resource to use. The possible values are shown in Table 4-9.
commData
A pointer to the communications resource that is stored with the desktop printer.
pRetry
On return, the Boolean value is true if QuickDraw GX needs to send the GXOpenConnection message again and false if not.
saveErr
The error code generated when the GXOpenConnection message failed.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
QuickDraw GX sends the GXOpenConnectionRetry message when a message handler calls the GXOpenConnection and it returns an error. You can override this message when you are implementing a communications protocol for a printer that can be shared by multiple users and accepts only one connection at a time. Your override can interpret the error that is specified in the saveErr parameter as an indication that the printer is in use by another user and that the connection attempt needs to be tried again.

The type of the communications resource, which you specify in the commType parameter, is one of the values shown in Table 4-9.
Table 4-9 Communications resource types
ConstantValueExplanation
Serial'SPTL'Serial communications resource
PAP'PPTL'AppleTalk PAP communications resource
SCSI'sPTL'SCSI communications resource
PrinterShare'ptsr'PrinterShare communications resource
NotConnected'Nops'No communications resource

The default implementation of the OpenRetryConnection message sets the value of the pRetry return parameter to false for most devices. The exception is for PAP devices that are using the PostScript imaging system. In this case, the default implementation sets the pRetry parameter value to true if it determines that the printer is busy with another user's print job.

If your device automatically handles retrying connections, override this message and set the pRetry parameter to true.

SPECIAL CONSIDERATIONS
You never send the GXOpenConnectionRetry message yourself.

If you are implementing a nonsupported type of communications connection, you need to perform a total override of the GXOpenConnectionRetry message. Otherwise, you need to first forward the message and then perform your tasks.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
SEE ALSO
The GXOpenConnection message is described in the previous section.

The communications ('comm') resource is described in the section "The Communications ('comm') Resource" beginning on page 6-36 in the chapter "Printing Resources."


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help